<template>
  <div>
    <el-select v-model="modelProperties" @change="handleChange">
      <el-option
        v-for="item in myOptions"
        :key="Number(item.dictValue)"
        :label="item.dictLabel"
        :value="item.dictValue"></el-option>
    </el-select>

    <el-radio-group v-model="createForm.rule_type">
      <el-radio :label="0">分值</el-radio>
      <el-radio :label="1">权重</el-radio>
    </el-radio-group>
    <span v-if="createForm.rule_type == 0"
      >每<el-input-number
        :min="1"
        v-model="createForm.rule_code1"></el-input-number
      >笔</span
    >
    <span v-else-if="createForm.rule_type == 1"
      >每<el-input-number
        :min="1"
        v-model="createForm.rule_code1"
        :max="100"></el-input-number
      >%</span
    >
    <span v-if="createForm.rule_type == 0 || createForm.rule_type == 1"
      >，扣<el-input-number
        :min="1"
        v-model="createForm.rule_code2"></el-input-number
      >分</span
    >
    <p>
      {{ this.createForm.rule_type }}:{{ this.createForm.rule_code1 }}:{{
        this.createForm.rule_code2
      }}
    </p>
    <p>
      {{ this.changeForm.rule_type }}:{{ this.changeForm.rule_code1 }}:{{
        this.changeForm.rule_code2
      }}
    </p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      modelProperties: undefined,
      myOptions: [
        {
          dictLabel: "常态化模型",
          dictValue: "00",
        },
        {
          dictLabel: "统计模型",
          dictValue: "01",
        },
        {
          dictLabel: "其他模型",
          dictValue: "02",
        },
      ],
      createForm: {
        rule_type: undefined,
        rule_code1: undefined,
        rule_code2: undefined,
      },
      changeForm: {},
    };
  },
  methods: {
    created() {
      this.createForm = {
        rule_type: 0,
        rule_code1: 2,
        rule_code2: 3,
      };
      this.changeForm = this.createForm;
    },
    handleChange(value) {
      console.log(value);
    },
    // handleRadio() {
    //   this.createForm = this.changeForm;
    // },
  },
  // computed: {
  //   createForm =
  // }
};
</script>
<style scoped></style>
